

# 下载链接格式如下：
# https://mmbiz.qpic.cn/mmbiz_jpg/5Y2xwHBh7lkt0Je1SybYoq5TDCnfJEqbCtPpHRpZ2H2l26LLBuEPaCOicKE91Ikhfb7UODdf4ogJxwU4W26VUbg/640?wx_fmt=other&from=appmsg#imgIndex=1
# https://mmbiz.qpic.cn/mmbiz_jpg/5Y2xwHBh7lkt0Je1SybYoq5TDCnfJEqbP0GV4CZdL50tpeyRia2RdVH6TmFzS6cSDn0doZR9RXOcSd5zNnbtYzw/640?wx_fmt=other&from=appmsg#imgIndex=1

"""
直接网页获取所有图片的链接
get所有图片格式的文件
download存到文件夹即可
"""

# 格式
url = 'https://mp.weixin.qq.com/s?__biz=MzkzNTk5NzcwNg==&mid=2247485337&idx=1&sn=6b5da51560d668fb1a14237acaa205a2&chksm=c2a43ffcf5d3b6eacfcccf2b974d838fb2b2908f8f74c5551345cdca68238cf3b16e5b969c5d&cur_album_id=4027268068027105282&scene=189#wechat_redirect'
#
# url = input("请输入需要下载的链接：")
#
# if  url:
#     print("开始获取网页所存在的图片链接……")
#     try:
#         response = requests.get(url)
#         print(f"内容：{response}")
#     except Exception as e:
#         print(f"error is : {e}")
# headers = {
#             'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36',
#             'Referer': 'https://mp.weixin.qq.com/'
#         }


# 仔细看上面代码没错，写的就是屎山代码！！！


import requests
from lxml import etree

url = input("请输入链接：")
response = requests.get(url)
print(response.text)
html = etree.HTML(response.text)

